<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>新闻资讯</title>
	<link rel="stylesheet" href="__PUBLIC__/home/css/bootstrap.min.css">
	<link rel="stylesheet" href="__PUBLIC__/home/css/common.css">
	<link rel="stylesheet" href="__PUBLIC__/home/css/news.css">
	<script src="__PUBLIC__/home/js/jquery.min.js"></script>
	<script src="__PUBLIC__/home/js/bootstrap.min.js"></script>
	<script src="__PUBLIC__/home/js/jquery.nav.js"></script>
	<script src="__PUBLIC__/home/js/jquery.SuperSlide.2.1.1.js"></script>
</head>

<body>
<!-- 头部开始 --> 
<div class="wrap">
	<nav class="navbar navbar-default">
		<div class="container-fluid container">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
					<span class="sr-only">Toggle navigation</span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
				<a class="navbar-brand logo" href="{:U('Index/index')}">
					<img src="__PUBLIC__/home/images/logo.png" alt="logo">
					<span>奥骞网络科技有限公司</span>
				</a>
			</div>
			<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
				<ul class="nav navbar-nav navbar-right">
					<li><a href="{:U('Index/index')}">首&nbsp;&nbsp;页</a></li>
					<li><a href="{:U('AboutUs/aboutUs')}">公司介绍</a></li>
					<li><a href="{:U('Class/index')}">培训课程</a></li>
					<li><a href="{:U('Example/example')}">案例展示</a></li>
					<li class="current"><a href="{:U('News/news')}">新闻资讯</a></li>
					<li><a href="{:U('ContactUs/contactUs')}">联系我们</a></li>
					<li><a href="{:U('JoinUs/joinUs')}">加入我们</a></li>
					<li><a href="{:U('Article/article')}">文章专栏</a></li>
				</ul>
				<div class="login">
					<a href="{:U('Index/login')}" class="active">登陆</a>
					<a href="{:U('Register/register')}">注册</a>
					<a href="{:U('Admin/Index/index')}">帮助</a>
				</div>
				<form class="navbar-form navbar-left">
					<div class="form-group">
						<input type="text" class="form-control" placeholder="搜索">
					</div>
					<button type="submit" class="btn btn-default">搜索</button>
				</form>
			</div><!-- /.navbar-collapse -->
		</div><!-- /.container-fluid -->
	</nav>
</div>
<!-- banner开始 -->
<div class="jumbotron">
	<div id="slideBox" class="slideBox">
	    <div class="hd">
	        <ul class="container">
				<?php foreach($bannerlist as $k=>$v){ ?>
				<li></li>
				<?php } ?>
	        </ul>
	    </div>
	    <div class="bd">
	        <ul>
				<?php foreach($bannerlist as $k=>$v){ ?>
				<img src="<?php echo $v['imgurl']?>" alt="">
				<?php } ?>
				<?php for($i=0;$i<count($bannerlist);$i++){ ?>
				<?php } ?>
	        </ul>
		</div>
	</div>
</div>
<!-- banner结束 -->
<!-- 头部结束 -->
<!-- 内容开始 -->
<div class="content">
	<div class="container-fluid nav">
		<div class="container">
			<ul class="row nav-list" id="news_nav">
				<li class="col-md-4 <?php if($type==2){echo ' current';}?> "><a href="JavaScript:void(0)">行业新闻
				<input type="hidden" value="2" class="code_type"></a></li>
				<li class="col-md-4 <?php if($type==3){echo ' current';}?> "><a href="JavaScript:void(0)">企业新闻 <input type="hidden" value="3" class="code_type"></a></li>
				<li class="col-md-4 <?php if($type==4){echo ' current';}?> "><a href="JavaScript:void(0)">技术新闻 <input type="hidden" value="4" class="code_type"></a></li>
			</ul>
		</div>
	</div>
	<div class="container-fluid news">
		<div class="container">
			<div class="row">
				<div class="col-md-4">
					<img src="__PUBLIC__/home/images/news.png">
				</div>
				<div class="col-md-5 col-md-offset-3 hot-news">
					<h2>热点新闻<img src="__PUBLIC__/home/images/hot-news.png"></h2>
					<ul>
						<?php foreach($hotnewsData as $K => $v ) { ?>
						<li class="row">
							<h6 class="col-md-2 col-sm-2 date"><?php echo $v['newsday']; ?><span><?php echo $v['newsyear']; ?></span></h6>
							<div class="hot-content col-md-10 col-sm-10">
								<h5><a href="#"><?php echo $v['newstitle']; ?></a></h5>
								<p><?php echo mb_substr($v['newscontent'],0,30,"UTF-8"); ?> ...</p>
							</div>
						</li>
						<?php } ?>
					</ul>
				</div>
				<div class="story">
					<h4>品牌故事<img src="__PUBLIC__/home/images/news-story.png"></h4>
					<p>实际上很多企业并不重视网站的基础建设，比如网站策划、网站设计、内容、组织等，但对后期网站推广的花费却舍得付出。这种现象，在我们从业多年的网我们惊讶那些设竟然也被用推广</p>
					<span>end</span>
				</div>
			</div>
		</div>
	</div>
	<div class="container-fluid create">
		<div class="container">
			<h2>创新典范<br><span>DSF EINDI E</span></h2>
			<div class="row" id="news_content">
				<?php foreach($newsData as $K => $v ) { ?>
				<div class="col-md-3 create-item">
					<h3><a href="#"><?php echo $v['newstitle']; ?></a></h3>
					<img src="<?php echo $v['imgurl']; ?>">
					<span>-<?php echo $v['newsdate']; ?></span>
					<p><?php echo mb_substr($v['newscontent'],0,80,"UTF-8"); ?> ...</p>
				</div>
				<?php } ?>
			</div>
			<a href="#" class="prev">-上一页  prev</a>
			<a href="#" class="next">下一页  next+</a>
		</div>
	</div>
</div>
<!-- 内容结束 -->
<!-- 尾部开始 -->
<div class="container-fluid footer-wrap">
	<div class="container">
		<ul class="footer">
			<li>奥骞网络科技，咨询:17318218552，企业合作：17318218221</li>
			<li>版权所有：重庆奥骞网络科技有限公司  川ICP备15032603号-2：</li>
			<li>技术支持：奥骞网络</li>
		</ul>
	</div>
</div>
<!-- 尾部结束 -->
</body> 
<!-- 新闻页面数据输出AJAX -->
<script>
$(function(){
	$('#news_nav li').on('click',function(){
		$(this).addClass("col-md-4 current").siblings().removeClass("current");
		var type=$(this).find('.code_type').val();
		// alert(type);
		$.ajax({
			url:"{:U('News/getAjax')}",
			type:"post",
			data:{type:type},
			success:function(result){
				// alert();
				var str="";
				var newscontent0=result[0]['newscontent'];	//截取字符串（页面只显示有限的信息）
				var newscontent1=result[1]['newscontent'];
				var newscontent2=result[2]['newscontent'];
				var str0=newscontent0.substring(0,90);
				var str1=newscontent1.substring(0,90);
				var str2=newscontent2.substring(0,90);
				str0+=' ...';
				str1+=' ...';
				str2+=' ...';
				newscontent0=str0;
				newscontent1=str1;
				newscontent2=str2;
				var newscontent=[newscontent0,newscontent1,newscontent2];
				for (i = 0; i < result.length; i++) {
					str+='<div class="col-md-3 create-item">';
					str+='<h3><a href="#">'+result[i]['newstitle']+'</a></h3>';
					str+='<img src="'+result[i]['imgurl']+'">';
					str+='<span>-'+result[i]['newsdate']+'</span>';
					str+='<p class="other-news-p">'+newscontent[i]+'</p>';
					str+='</div>';
					$("#news_content").html(str);
				}
			}
		})
	});
})
<!-- 字体 -->
<script>
	$(function(){
		//alert();
		changefontsize();
		$(window).resize(function(){
			changefontsize();
		});

		$('#nav').onePageNav({              //单页平滑导航插件
        begin:function(){
            if ($("#list_btn").css("display")=="block"){
                $("#list_btn").click();   //当按钮显示时，在执行动作之前给#list_btn一个直接点击事件，关闭按钮
            	}
        	},
    	});
	});

	function changefontsize(){
		var fontsize='';
		var screenwidth=$(window).width();
		//alert(screenwidth);
		fontsize=screenwidth*0.01167;
		$('body,html').css("font-size",fontsize+'px');
	};
</script>
<!-- 轮播插件 -->
<script>
	jQuery(".slideBox").slide({mainCell:".bd ul",autoPlay:true});			 
</script>
</html>